#!/bin/bash
OK=0
WARN=1

PowerValue=""

res=$(ipmitool sdr list all|grep Voltage|awk '{print $4}')
for i in ${res[@]};do
        PowerValue="$PowerValue $i"
        if [ $i -eq 0 ];then
                echo "Power is $PowerValue lost!!!"
                exit ${WARN}
        fi
done

echo "Power is $PowerValue OK!"
exit 0

